3.1.48 \(\int \frac {\cos (c+d x)}{a+a \sec (c+d x)} \, dx\) [48]

Optimal. Leaf size=44 \[ -\frac {x}{a}+\frac {2 \sin (c+d x)}{a d}-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))} \]

[Out]

-x/a+2*sin(d*x+c)/a/d-sin(d*x+c)/d/(a+a*sec(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3904, 3872, 2717, 8} \begin {gather*} \frac {2 \sin (c+d x)}{a d}-\frac {\sin (c+d x)}{d (a \sec (c+d x)+a)}-\frac {x}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]/(a + a*Sec[c + d*x]),x]

[Out]

-(x/a) + (2*Sin[c + d*x])/(a*d) - Sin[c + d*x]/(d*(a + a*Sec[c + d*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3904

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[Cot[e + f*x
]*((d*Csc[e + f*x])^n/(f*(a + b*Csc[e + f*x]))), x] - Dist[1/a^2, Int[(d*Csc[e + f*x])^n*(a*(n - 1) - b*n*Csc[
e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && LtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\cos (c+d x)}{a+a \sec (c+d x)} \, dx &=-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int \cos (c+d x) (-2 a+a \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int 1 \, dx}{a}+\frac {2 \int \cos (c+d x) \, dx}{a}\\ &=-\frac {x}{a}+\frac {2 \sin (c+d x)}{a d}-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(89\) vs. \(2(44)=88\).
time = 0.24, size = 89, normalized size = 2.02 \begin {gather*} \frac {\sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (-2 d x \cos \left (\frac {d x}{2}\right )-2 d x \cos \left (c+\frac {d x}{2}\right )+5 \sin \left (\frac {d x}{2}\right )+\sin \left (c+\frac {d x}{2}\right )+\sin \left (c+\frac {3 d x}{2}\right )+\sin \left (2 c+\frac {3 d x}{2}\right )\right )}{4 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]/(a + a*Sec[c + d*x]),x]

[Out]

(Sec[c/2]*Sec[(c + d*x)/2]*(-2*d*x*Cos[(d*x)/2] - 2*d*x*Cos[c + (d*x)/2] + 5*Sin[(d*x)/2] + Sin[c + (d*x)/2] +
 Sin[c + (3*d*x)/2] + Sin[2*c + (3*d*x)/2]))/(4*a*d)

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 56, normalized size = 1.27

method result size
derivativedivides \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) \(56\)
default \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) \(56\)
risch \(-\frac {x}{a}-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {2 i}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) \(66\)
norman \(\frac {\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {x}{a}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\) \(76\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(tan(1/2*d*x+1/2*c)+2*tan(1/2*d*x+1/2*c)/(1+tan(1/2*d*x+1/2*c)^2)-2*arctan(tan(1/2*d*x+1/2*c)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (44) = 88\).
time = 0.49, size = 92, normalized size = 2.09 \begin {gather*} -\frac {\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

-(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - 2*sin(d*x + c)/((a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(c
os(d*x + c) + 1)) - sin(d*x + c)/(a*(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

Fricas [A]
time = 2.88, size = 46, normalized size = 1.05 \begin {gather*} -\frac {d x \cos \left (d x + c\right ) + d x - {\left (\cos \left (d x + c\right ) + 2\right )} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

-(d*x*cos(d*x + c) + d*x - (cos(d*x + c) + 2)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cos {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+a*sec(d*x+c)),x)

[Out]

Integral(cos(c + d*x)/(sec(c + d*x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 58, normalized size = 1.32 \begin {gather*} -\frac {\frac {d x + c}{a} - \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

-((d*x + c)/a - tan(1/2*d*x + 1/2*c)/a - 2*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 + 1)*a))/d

________________________________________________________________________________________

Mupad [B]
time = 0.66, size = 66, normalized size = 1.50 \begin {gather*} \frac {2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (-c-d\,x\right )\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)/(a + a/cos(c + d*x)),x)

[Out]

(sin(c/2 + (d*x)/2) - cos(c/2 + (d*x)/2)*(c + d*x) + 2*cos(c/2 + (d*x)/2)^2*sin(c/2 + (d*x)/2))/(a*d*cos(c/2 +
 (d*x)/2))

________________________________________________________________________________________